Define agent integration contracts - #27
Conversation
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis change defines versioned agent-integration contracts for MCP and CLI adapters, including task/session schemas, errors, warnings, envelopes, command behavior, session semantics, fixtures, and repository asset validation. Production MCP and CLI handlers remain out of scope. ChangesAgent integration contracts
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/interfaces/contracts/task-contract.ts`:
- Around line 59-81: Update editableInputFields and the shared hasEditableInput
validation so each clear flag is rejected when its corresponding value is
supplied, preventing conflicting edit directives in both mutationInputSchema and
taskEditInputSchema. Explicitly define whether null represents an MCP clear
operation, then make the corresponding field schemas and clear-flag validation
consistently accept or reject that representation.
In `@src/interfaces/contracts/warning-contract.ts`:
- Around line 15-22: The envelope payload schemas currently accept non-JSON
values, so define a shared recursive JSON-value schema and replace
cliSuccessEnvelopeSchema.data in
src/interfaces/contracts/warning-contract.ts:15-22 and
contractErrorSchema.details in src/interfaces/contracts/error-contract.ts:14-20
with it. Add tests covering accepted envelopes to verify JSON.stringify succeeds
without omission or failure.
In `@tests/unit/interfaces/contracts/agent-integration-contracts.test.ts`:
- Around line 194-206: Update the fixture validation loop in
tests/unit/interfaces/contracts/agent-integration-contracts.test.ts:194-206 to
parse each capture fixture’s CLI envelope with its existing parser, then
validate the envelope data using taskCaptureResultSchema. In
tests/fixtures/contracts/capture-success.json:4-5 and
tests/fixtures/contracts/capture-duplicate-warning.json:4-10, replace the
ID-only task data with complete public task DTOs while preserving the duplicate
warning in the latter fixture.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4f5c88d4-5e16-4dcd-a26d-d1254eacee80
📒 Files selected for processing (20)
README.mddocs/cli-reference.mddocs/decisions/0002-agent-integration-contracts.mddocs/mcp-tools.mddocs/session-semantics.mddocs/superpowers/plans/2026-07-26-agent-integration-contracts.mdscripts/validate-repository-assets.tssrc/interfaces/contracts/contract-version.tssrc/interfaces/contracts/error-contract.tssrc/interfaces/contracts/session-contract.tssrc/interfaces/contracts/task-contract.tssrc/interfaces/contracts/warning-contract.tstests/fixtures/contracts/capture-duplicate-warning.jsontests/fixtures/contracts/capture-success.jsontests/fixtures/contracts/not-found-error.jsontests/fixtures/contracts/storage-error.jsontests/fixtures/contracts/transition-conflict-error.jsontests/fixtures/contracts/validation-error.jsontests/unit/interfaces/contracts/agent-integration-contracts.test.tstests/unit/scripts/validate-repository-assets.test.ts
Summary
Validation
pnpm verify reaches its audit step but pnpm 10.2.0 running under unsupported Node 25 fails to parse the registry gzip response. The repository requires Node 24, which is not installed locally.
Closes #19
Summary by CodeRabbit
New Features
Documentation
Tests